import TreeNode, {buildBinarySearchTree, BinarySearch, findMin,findMax,deleteNode} from "../MyClass/BinarySearchTree.js"; //  构造函数
import {inOrder} from "../MyClass/Tree.js";

let arr=[]
for(let i=0;i<10;i++){
    arr.push(Math.floor(Math.random()*20))
}



let tree=buildBinarySearchTree(arr)



console.log(inOrder(tree).join(" "));
console.log("选择删除："+arr[0]);
tree=deleteNode(tree,arr[0])
console.log(inOrder(tree).join(" "));